﻿using System.Collections;
using System.Collections.Generic;
using System.Windows.Controls;
using System.Windows.Input;
using delitel.Models;
using delitel.View;

namespace delitel.ViewModel
{
    internal class MainWindowsViewModel : MainViewModel
    {
     

        private string gg = "";
        public string Gg { get => gg; set => Set(ref gg, value); }
        private Page page;
        public Page Page { get => page; set => Set(ref page, value); }

        private bool visibility;
        public bool Visibility { get => visibility; set => Set(ref visibility, value); }
/*---------------------------------------------------------------------------------------------------------------------------------------------------*/

        #region
        public ICommand OpenMenu {get; protected set;}
        private bool canOpenMenuExecute(object p) => true;
        private void OnOpenMenuExecuted(object p)
        {
            Visibility=true;

        }
#endregion

        #region
        public ICommand CloseMenu { get; protected set; }
        private bool canCloseMenuExecute(object p) => true;
        private void OnCloseMenuExecuted(object p)
        {
            Visibility = false;
        }
        #endregion

        #region
        public ICommand CloseCommand { get; protected set; }
        private bool canCloseCommandExecute(object p) => true;
        private void OnCloseCommandExecuted(object p)
        {

            App.Current.Shutdown();


        }
        #endregion

        #region
        public ICommand OpenPageResistorCommand { get; protected set; }
        private bool canOpenPageResistorCommandExecute(object p) => true;
        private void OnOpenPageResistorCommandExecuted(object p)
        {
            Page = new DivideResistor();
        }
        #endregion




        public MainWindowsViewModel()
        {
            CloseCommand = new LambdaCommand(OnCloseCommandExecuted, canCloseCommandExecute);
            OpenPageResistorCommand = new LambdaCommand(OnOpenPageResistorCommandExecuted, canOpenPageResistorCommandExecute);
            OpenMenu=new LambdaCommand(OnOpenMenuExecuted, canOpenMenuExecute);
            CloseMenu=new LambdaCommand(OnCloseMenuExecuted, canCloseMenuExecute);
            visibility = false;
 
        }




    }
}
